package com.shanks.home.module.image;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;

import com.shanks.home.MainActivity;
import com.shanks.home.R;

public class ImageActivity extends Activity {
	
	private Button canvasBtn, bgMoveBtn, surfaceViewBtn;
	
	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		
		this.setContentView(R.layout.image_activity);
		initView();
	}
	
	private void initView() {
		canvasBtn = (Button)this.findViewById(R.id.image_canvas_btn);
		bgMoveBtn = (Button)this.findViewById(R.id.image_bg_move_btn);
		surfaceViewBtn = (Button)this.findViewById(R.id.image_surface_view_btn);
		
		canvasBtn.setOnClickListener(onClickListener);
		bgMoveBtn.setOnClickListener(onClickListener);
		surfaceViewBtn.setOnClickListener(onClickListener);
	}
	
	private OnClickListener onClickListener = new OnClickListener() {
		
		@Override
		public void onClick(View v) {
			if (v == canvasBtn) {
				canvasFunc();
			} else if (v == bgMoveBtn) {
				startActivity(new Intent(ImageActivity.this, BgMoveActivity.class));
			} else if (v == surfaceViewBtn) {
				startActivity(new Intent(ImageActivity.this, SurfaceViewActivity.class));
			}
		}
	};
	
	private void canvasFunc() {
		startActivity(new Intent(ImageActivity.this, ImageShowActivity.class));
	}
}